<#include "../inc/header.ftl" />
<div class="admin-content">
    <ui id="error" class="message error" style="display:none;"></ui>
    <form id="dailyForm" name="dailyForm" method="post" action="${base}/admin/daily/create/do">
        <input type="hidden" name="format" id="format" value="${format}"/>
        <input type="hidden" name="imageList" id="imageList"/>
        <table class="formtable">
            <tr>
                <td class="label" style="width: 100px;">标题</td>
                <td class="field" colspan="3"><input type="text" class="textinput" name="title"/></td>
            </tr>
            <tr>
                <td colspan="4">
                <#include "daily-image.ftl" />
                </td>
            </tr>
            <tr>
                <td class="field" colspan="4">
                <#if format == 'html'>
                    <!-- html编辑器 -->
                    <script type="text/javascript" src="${base}/static/js/kindeditor/kindeditor-all-min.js"></script>
                    <textarea id="content" name="content" style="width:100%;height:680px;"></textarea>
                    <script>
                        $(document).ready(function () {
                            admin.htmlEditor = admin.editor.html('content');
                        });
                    </script>
                <#else>
                    <!-- markdown编辑器 -->
                    <link rel="stylesheet" href="${base}/static/js/editor.md/css/editormd.css"/>
                    <script type="text/javascript" src="${base}/static/js/editor.md/editormd.min.js"></script>
                    <div id="content" style="margin: 0px;padding: 0px;">
                        <textarea id="markdownContent" name="content" style="display: none;"></textarea>
                    </div>
                    <script>
                        $(document).ready(function () {
                            admin.markdownEditor = admin.editor.markdown('content');
                        });
                    </script>
                </#if>
                </td>
            </tr>
            <tr>
                <td colspan="4" class="toolbar">
                    <input class="btn btn-default" type="submit" value="提交表单"/>
                </td>
            </tr>
        </table>
    </form>
</div>
<script type="text/javascript" src="${base}/static/js/jquery-tagsinput/jquery.tagsinput.min.js"></script>
<link rel="stylesheet" href="${base}/static/js/jquery-tagsinput/jquery.tagsinput.css"/>
<script type="text/javascript">
    $(document).ready(function () {
        admin.daily.validateForm();
    });
</script>
<#include "../inc/footer.ftl" />